import { updateDeptById } from "./../dept/index";
import request from "@/utils/request";
import type {
  SearchClazzModel,
  ClazzModel,
  ClazzModelArray,
  ResultModel,
} from "@/api/model/model";

export const queryClazzList = async (
  name: string,
  begin: string,
  end: string,
  page: number,
  pageSize: number
) => {
  return await request.get(
    `/clazzs?name=${name}&begin=${begin}&end=${end}&page=${page}&pageSize=${pageSize}`
  );
};

export const queryClazzLists = async () => {
  return await request.get(`/clazzs/list`);
};

export const addClazz = async (clazz) => await request.post(`/clazzs`,clazz);

export const getClazzById = async (id: number) =>
  await request.get(`/clazzs/${id}`);

export const updateClazz = async (clazz) =>
  await request.put(`/clazzs`,clazz);


export const deleteClazzById = (id: string) =>
  request.delete<any, ResultModel>(`/clazzs/${id}`);